using DG.Tweening;
using RStudio.UIFramwork;
using System.Numerics;


/// <Summary>
///
/// </Summary>
[UIDetail("PageEntry", "PageEntry")]
public class PageEntry : UIBase
{
	/// <Summary>
	/// 本地组件集
	/// </Summary>
	public DetailPageEntry Detail;
	

	public override void InitComponent()
	{
		Detail = new DetailPageEntry(transform);
	}

    public override void ActiveUI()
    {
		base.ActiveUI();

		var uiSequence = DOTween.Sequence();
		uiSequence.Append(this.Detail.RT_Btn_Click.DOScaleX(1.5f, 2f));
        uiSequence.Join(this.Detail.RT_Btn_Click.DOScaleY(1.5f, 2f));
        uiSequence.Append(this.Detail.RT_Btn_Click.DOScaleX(1f, 2f));
        uiSequence.Join(this.Detail.RT_Btn_Click.DOScaleY(1f, 2f));
        uiSequence.Play().SetEase(Ease.Linear).SetLoops(-1);


		this.Detail.BTN_Btn_Click.onClick.AddListener(() =>
		{
			UIModuleCenter.Instance.SendToQueue(new UIEventArg()
			{
				Type = typeof(PageUIModuleCenter),
				UIEventType = UIEventType.Open,
			});
		});

		this.Detail.TextMeshProUGUI_Tooltip.text = $"{this.GetType().Name} | 功能详细：【关旧】{this.UseClosePrevious} 【可被关】{this.CanBeClosed}";
    }

    public override void DeActiveUI()
    {
        base.DeActiveUI();
		this.Detail.BTN_Btn_Click.onClick = null;
    }
}
